import request from '@/utils/request'

export function saveAddress(data) {
  return request({
    url: '/ums/address',
    method: 'post',
    data
  })
}

export function updateAddressIsFlag(params) {
  return request({
    url: '/ums/address/update-flag',
    method: 'get',
    params
  })
}

export function getAddressByUserId(userId) {
  return request({
    url: '/ums/address/user/' + userId,
    method: 'get',
  })
}
export function getAddressById(addressId) {
  return request({
    url: '/ums/address/' + addressId,
    method: 'get',
  })
}
export function getDefaultAddress(userId) {
  return request({
    url: '/ums/address/default/' + userId,
    method: 'get',
  })
}


export function deleteAddress(id) {
  return request({
    url: '/ums/address/' + id,
    method: 'delete',
  })
}

